import { createApp } from 'vue';
import './style.css';
import App from './App.vue';
import router from './router';
import 'nprogress/nprogress.css';
import NProgress from 'nprogress';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import { setupStore } from '/@/store';
import '@/assets/font/font.css'; // 字体
import 'vue-cropper/dist/index.css';
import { VueCropper } from 'vue-cropper';
// 添加顶部的加载进度条
router.beforeEach((to, from, next) => {
  if (to.path !== from.path) {
    NProgress.start();
  }
  next();
});

router.afterEach((to, from) => {
  if (to.path !== from.path) {
    NProgress.done();
    document.documentElement.scrollTop = 0;
  }
});

const app = createApp(App);
setupStore(app);
// @ts-ignore
app.use(VueCropper);
app.use(router).use(Antd).mount('#app');
